home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / src / gdb-4.12 / opcodes / sparc-op.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-03  |  43.9 KB  |  822 lines

  1.  
  2. /* Table of opcodes for the sparc.
  3.     Copyright 1989, 1991, 1992 Free Software Foundation, Inc.
  4.  
  5. This file is part of the BFD library.
  6.  
  7. BFD is free software; you can redistribute it and/or modify it under
  8. the terms of the GNU General Public License as published by the Free
  9. Software Foundation; either version 2, or (at your option) any later
  10. version.
  11.  
  12. BFD is distributed in the hope that it will be useful, but WITHOUT ANY
  13. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  15. for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this software; see the file COPYING.  If not, write to
  19. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.    */
  20.  
  21. /* FIXME-someday: perhaps the ,a's and such should be embedded in the
  22.    instruction's name rather than the args.  This would make gas faster, pinsn
  23.    slower, but would mess up some macros a bit.  xoxorich. */
  24.  
  25.  
  26. #include <stdio.h>
  27. #include "ansidecl.h"
  28. #include "opcode/sparc.h"
  29.  
  30. const char *architecture_pname[] = {
  31.     "v6",
  32.     "v7",
  33.     "v8",
  34.     "sparclite",
  35.     NULL,
  36. };
  37.  
  38.  
  39. /* Branch condition field.  */
  40. #define COND(x)        (((x)&0xf)<<25)
  41.  
  42.  
  43.  
  44. #define CONDA    (COND(0x8))
  45. #define CONDCC    (COND(0xd))
  46. #define CONDCS    (COND(0x5))
  47. #define CONDE    (COND(0x1))
  48. #define CONDG    (COND(0xa))
  49. #define CONDGE    (COND(0xb))
  50. #define CONDGU    (COND(0xc))
  51. #define CONDL    (COND(0x3))
  52. #define CONDLE    (COND(0x2))
  53. #define CONDLEU    (COND(0x4))
  54. #define CONDN    (COND(0x0))
  55. #define CONDNE    (COND(0x9))
  56. #define CONDNEG    (COND(0x6))
  57. #define CONDPOS    (COND(0xe))
  58. #define CONDVC    (COND(0xf))
  59. #define CONDVS    (COND(0x7))
  60.  
  61. #define CONDNZ    CONDNE
  62. #define CONDZ    CONDE
  63. #define CONDGEU    CONDCC
  64. #define CONDLU    CONDCS
  65.  
  66. #define FCONDA        (COND(0x8))
  67. #define FCONDE        (COND(0x9))
  68. #define FCONDG        (COND(0x6))
  69. #define FCONDGE        (COND(0xb))
  70. #define FCONDL        (COND(0x4))
  71. #define FCONDLE        (COND(0xd))
  72. #define FCONDLG        (COND(0x2))
  73. #define FCONDN        (COND(0x0))
  74. #define FCONDNE        (COND(0x1))
  75. #define FCONDO        (COND(0xf))
  76. #define FCONDU        (COND(0x7))
  77. #define FCONDUE        (COND(0xa))
  78. #define FCONDUG        (COND(0x5))
  79. #define FCONDUGE    (COND(0xc))
  80. #define FCONDUL        (COND(0x3))
  81. #define FCONDULE    (COND(0xe))
  82.  
  83. #define FCONDNZ    FCONDNE
  84. #define FCONDZ    FCONDE
  85.  
  86.  
  87. /* The order of the opcodes in the table is significant:
  88.     
  89.     * The assembler requires that all instances of the same mnemonic must
  90.     be consecutive.    If they aren't, the assembler will bomb at runtime.
  91.  
  92.     * The disassembler should not care about the order of the opcodes.
  93.  
  94. */
  95.  
  96. struct sparc_opcode sparc_opcodes[] = {
  97.  
  98. { "ld",    F3(3, 0x00, 0), F3(~3, ~0x00, ~0),        "[1+2],d", 0, v6 },
  99. { "ld",    F3(3, 0x00, 0), F3(~3, ~0x00, ~0)|RS2_G0,    "[1],d", 0, v6 }, /* ld [rs1+%g0],d */
  100. { "ld",    F3(3, 0x00, 1), F3(~3, ~0x00, ~1),        "[1+i],d", 0, v6 },
  101. { "ld",    F3(3, 0x00, 1), F3(~3, ~0x00, ~1),        "[i+1],d", 0, v6 },
  102. { "ld",    F3(3, 0x00, 1), F3(~3, ~0x00, ~1)|RS1_G0,    "[i],d", 0, v6 },
  103. { "ld",    F3(3, 0x00, 1), F3(~3, ~0x00, ~1)|SIMM13(~0),    "[1],d", 0, v6 }, /* ld [rs1+0],d */
  104. { "ld",    F3(3, 0x20, 0), F3(~3, ~0x20, ~0),        "[1+2],g", 0, v6 },
  105. { "ld",    F3(3, 0x20, 0), F3(~3, ~0x20, ~0)|RS2_G0,    "[1],g", 0, v6 }, /* ld [rs1+%g0],d */
  106. { "ld",    F3(3, 0x20, 1), F3(~3, ~0x20, ~1),        "[1+i],g", 0, v6 },
  107. { "ld",    F3(3, 0x20, 1), F3(~3, ~0x20, ~1),        "[i+1],g", 0, v6 },
  108. { "ld",    F3(3, 0x20, 1), F3(~3, ~0x20, ~1)|RS1_G0,    "[i],g", 0, v6 },
  109. { "ld",    F3(3, 0x20, 1), F3(~3, ~0x20, ~1)|SIMM13(~0),    "[1],g", 0, v6 }, /* ld [rs1+0],d */
  110.  
  111. { "ld",    F3(3, 0x21, 0), F3(~3, ~0x21, ~0)|RD(~0),    "[1+2],F", 0, v6 },
  112. { "ld",    F3(3, 0x21, 0), F3(~3, ~0x21, ~0)|RS2_G0|RD(~0),"[1],F", 0, v6 }, /* ld [rs1+%g0],d */
  113. { "ld",    F3(3, 0x21, 1), F3(~3, ~0x21, ~1)|RD(~0),    "[1+i],F", 0, v6 },
  114. { "ld",    F3(3, 0x21, 1), F3(~3, ~0x21, ~1)|RD(~0),    "[i+1],F", 0, v6 },
  115. { "ld",    F3(3, 0x21, 1), F3(~3, ~0x21, ~1)|RS1_G0|RD(~0),"[i],F", 0, v6 },
  116. { "ld",    F3(3, 0x21, 1), F3(~3, ~0x21, ~1)|SIMM13(~0)|RD(~0),"[1],F", 0, v6 }, /* ld [rs1+0],d */
  117.  
  118. { "ld",    F3(3, 0x30, 0), F3(~3, ~0x30, ~0),        "[1+2],D", F_ALIAS, v6 },
  119. { "ld",    F3(3, 0x30, 0), F3(~3, ~0x30, ~0)|RS2_G0,    "[1],D", F_ALIAS, v6 }, /* ld [rs1+%g0],d */
  120. { "ld",    F3(3, 0x30, 1), F3(~3, ~0x30, ~1),        "[1+i],D", F_ALIAS, v6 },
  121. { "ld",    F3(3, 0x30, 1), F3(~3, ~0x30, ~1),        "[i+1],D", F_ALIAS, v6 },
  122. { "ld",    F3(3, 0x30, 1), F3(~3, ~0x30, ~1)|RS1_G0,    "[i],D", F_ALIAS, v6 },
  123. { "ld",    F3(3, 0x30, 1), F3(~3, ~0x30, ~1)|SIMM13(~0),    "[1],D", F_ALIAS, v6 }, /* ld [rs1+0],d */
  124. { "ld",    F3(3, 0x31, 0), F3(~3, ~0x31, ~0),        "[1+2],C", 0, v6 },
  125. { "ld",    F3(3, 0x31, 0), F3(~3, ~0x31, ~0)|RS2_G0,    "[1],C", 0, v6 }, /* ld [rs1+%g0],d */
  126. { "ld",    F3(3, 0x31, 1), F3(~3, ~0x31, ~1),        "[1+i],C", 0, v6 },
  127. { "ld",    F3(3, 0x31, 1), F3(~3, ~0x31, ~1),        "[i+1],C", 0, v6 },
  128. { "ld",    F3(3, 0x31, 1), F3(~3, ~0x31, ~1)|RS1_G0,    "[i],C", 0, v6 },
  129. { "ld",    F3(3, 0x31, 1), F3(~3, ~0x31, ~1)|SIMM13(~0),    "[1],C", 0, v6 }, /* ld [rs1+0],d */
  130.  
  131.  
  132. { "ldd",    F3(3, 0x03, 0), F3(~3, ~0x03, ~0)|ASI(~0),    "[1+2],d", 0, v6 },
  133. { "ldd",    F3(3, 0x03, 0), F3(~3, ~0x03, ~0)|ASI_RS2(~0),    "[1],d", 0, v6 }, /* ldd [rs1+%g0],d */
  134. { "ldd",    F3(3, 0x03, 1), F3(~3, ~0x03, ~1),        "[1+i],d", 0, v6 },
  135. { "ldd",    F3(3, 0x03, 1), F3(~3, ~0x03, ~1),        "[i+1],d", 0, v6 },
  136. { "ldd",    F3(3, 0x03, 1), F3(~3, ~0x03, ~1)|RS1_G0,    "[i],d", 0, v6 },
  137. { "ldd",    F3(3, 0x03, 1), F3(~3, ~0x03, ~1)|SIMM13(~0),    "[1],d", 0, v6 }, /* ldd [rs1+0],d */
  138. { "ldd",    F3(3, 0x23, 0), F3(~3, ~0x23, ~0)|ASI(~0),    "[1+2],H", 0, v6 },
  139. { "ldd",    F3(3, 0x23, 0), F3(~3, ~0x23, ~0)|ASI_RS2(~0),    "[1],H", 0, v6 }, /* ldd [rs1+%g0],d */
  140. { "ldd",    F3(3, 0x23, 1), F3(~3, ~0x23, ~1),        "[1+i],H", 0, v6 },
  141. { "ldd",    F3(3, 0x23, 1), F3(~3, ~0x23, ~1),        "[i+1],H", 0, v6 },
  142. { "ldd",    F3(3, 0x23, 1), F3(~3, ~0x23, ~1)|RS1_G0,    "[i],H", 0, v6 },
  143. { "ldd",    F3(3, 0x23, 1), F3(~3, ~0x23, ~1)|SIMM13(~0),    "[1],H", 0, v6 }, /* ldd [rs1+0],d */
  144. { "ldd",    F3(3, 0x33, 0), F3(~3, ~0x33, ~0)|ASI(~0),    "[1+2],D", F_ALIAS, v6 },
  145. { "ldd",    F3(3, 0x33, 0), F3(~3, ~0x33, ~0)|ASI_RS2(~0),    "[1],D", F_ALIAS, v6 }, /* ldd [rs1+%g0],d */
  146. { "ldd",    F3(3, 0x33, 1), F3(~3, ~0x33, ~1),        "[1+i],D", F_ALIAS, v6 },
  147. { "ldd",    F3(3, 0x33, 1), F3(~3, ~0x33, ~1),        "[i+1],D", F_ALIAS, v6 },
  148. { "ldd",    F3(3, 0x33, 1), F3(~3, ~0x33, ~1)|RS1_G0,    "[i],D", F_ALIAS, v6 },
  149. { "ldd",    F3(3, 0x33, 1), F3(~3, ~0x33, ~1)|SIMM13(~0),    "[1],D", F_ALIAS, v6 }, /* ldd [rs1+0],d */
  150.  
  151.  
  152. { "ldsb",    F3(3, 0x09, 0), F3(~3, ~0x09, ~0)|ASI(~0),    "[1+2],d", 0, v6 },
  153. { "ldsb",    F3(3, 0x09, 0), F3(~3, ~0x09, ~0)|ASI_RS2(~0),    "[1],d", 0, v6 }, /* ldsb [rs1+%g0],d */
  154. { "ldsb",    F3(3, 0x09, 1), F3(~3, ~0x09, ~1),        "[1+i],d", 0, v6 },
  155. { "ldsb",    F3(3, 0x09, 1), F3(~3, ~0x09, ~1),        "[i+1],d", 0, v6 },
  156. { "ldsb",    F3(3, 0x09, 1), F3(~3, ~0x09, ~1)|RS1_G0,    "[i],d", 0, v6 },
  157. { "ldsb",    F3(3, 0x09, 1), F3(~3, ~0x09, ~1)|SIMM13(~0),    "[1],d", 0, v6 }, /* ldsb [rs1+0],d */
  158.  
  159. { "ldsh",    F3(3, 0x0a, 0), F3(~3, ~0x0a, ~0)|ASI_RS2(~0),    "[1],d", 0, v6 }, /* ldsh [rs1+%g0],d */
  160. { "ldsh",    F3(3, 0x0a, 0), F3(~3, ~0x0a, ~0)|ASI(~0),    "[1+2],d", 0, v6 },
  161. { "ldsh",    F3(3, 0x0a, 1), F3(~3, ~0x0a, ~1),        "[1+i],d", 0, v6 },
  162. { "ldsh",    F3(3, 0x0a, 1), F3(~3, ~0x0a, ~1),        "[i+1],d", 0, v6 },
  163. { "ldsh",    F3(3, 0x0a, 1), F3(~3, ~0x0a, ~1)|RS1_G0,    "[i],d", 0, v6 },
  164. { "ldsh",    F3(3, 0x0a, 1), F3(~3, ~0x0a, ~1)|SIMM13(~0),    "[1],d", 0, v6 }, /* ldsh [rs1+0],d */
  165.  
  166. { "ldstub",    F3(3, 0x0d, 0), F3(~3, ~0x0d, ~0)|ASI(~0),    "[1+2],d", 0, v6 },
  167. { "ldstub",    F3(3, 0x0d, 0), F3(~3, ~0x0d, ~0)|ASI_RS2(~0),    "[1],d", 0, v6 }, /* ldstub [rs1+%g0],d */
  168. { "ldstub",    F3(3, 0x0d, 1), F3(~3, ~0x0d, ~1),        "[1+i],d", 0, v6 },
  169. { "ldstub",    F3(3, 0x0d, 1), F3(~3, ~0x0d, ~1),        "[i+1],d", 0, v6 },
  170. { "ldstub",    F3(3, 0x0d, 1), F3(~3, ~0x0d, ~1)|RS1_G0,    "[i],d", 0, v6 },
  171. { "ldstub",    F3(3, 0x0d, 1), F3(~3, ~0x0d, ~1)|SIMM13(~0),    "[1],d", 0, v6 }, /* ldstub [rs1+0],d */
  172.  
  173.  
  174. { "ldub",    F3(3, 0x01, 0), F3(~3, ~0x01, ~0)|ASI(~0),    "[1+2],d", 0, v6 },
  175. { "ldub",    F3(3, 0x01, 0), F3(~3, ~0x01, ~0)|ASI_RS2(~0),    "[1],d", 0, v6 }, /* ldub [rs1+%g0],d */
  176. { "ldub",    F3(3, 0x01, 1), F3(~3, ~0x01, ~1),        "[1+i],d", 0, v6 },
  177. { "ldub",    F3(3, 0x01, 1), F3(~3, ~0x01, ~1),        "[i+1],d", 0, v6 },
  178. { "ldub",    F3(3, 0x01, 1), F3(~3, ~0x01, ~1)|RS1_G0,    "[i],d", 0, v6 },
  179. { "ldub",    F3(3, 0x01, 1), F3(~3, ~0x01, ~1)|SIMM13(~0),    "[1],d", 0, v6 }, /* ldub [rs1+0],d */
  180.  
  181. { "lduh",    F3(3, 0x02, 0), F3(~3, ~0x02, ~0)|ASI(~0),    "[1+2],d", 0, v6 },
  182. { "lduh",    F3(3, 0x02, 0), F3(~3, ~0x02, ~0)|ASI_RS2(~0),    "[1],d", 0, v6 }, /* lduh [rs1+%g0],d */
  183. { "lduh",    F3(3, 0x02, 1), F3(~3, ~0x02, ~1),        "[1+i],d", 0, v6 },
  184. { "lduh",    F3(3, 0x02, 1), F3(~3, ~0x02, ~1),        "[i+1],d", 0, v6 },
  185. { "lduh",    F3(3, 0x02, 1), F3(~3, ~0x02, ~1)|RS1_G0,    "[i],d", 0, v6 },
  186. { "lduh",    F3(3, 0x02, 1), F3(~3, ~0x02, ~1)|SIMM13(~0),    "[1],d", 0, v6 }, /* lduh [rs1+0],d */
  187.  
  188.  
  189.  
  190. { "lda",    F3(3, 0x10, 0), F3(~3, ~0x10, ~0),        "[1+2]A,d", 0, v6 },
  191. { "lda",    F3(3, 0x10, 0), F3(~3, ~0x10, ~0)|RS2_G0,    "[1]A,d", 0, v6 }, /* lda [rs1+%g0],d */
  192.  
  193. { "ldda",    F3(3, 0x13, 0), F3(~3, ~0x13, ~0),        "[1+2]A,d", 0, v6 },
  194. { "ldda",    F3(3, 0x13, 0), F3(~3, ~0x13, ~0)|RS2_G0,    "[1]A,d", 0, v6 }, /* ldda [rs1+%g0],d */
  195.  
  196.  
  197.  
  198. { "ldsba",    F3(3, 0x19, 0), F3(~3, ~0x19, ~0),        "[1+2]A,d", 0, v6 },
  199. { "ldsba",    F3(3, 0x19, 0), F3(~3, ~0x19, ~0)|RS2_G0,    "[1]A,d", 0, v6 }, /* ldsba [rs1+%g0],d */
  200.  
  201. { "ldsha",    F3(3, 0x1a, 0), F3(~3, ~0x1a, ~0),        "[1+2]A,d", 0, v6 },
  202. { "ldsha",    F3(3, 0x1a, 0), F3(~3, ~0x1a, ~0)|RS2_G0,    "[1]A,d", 0, v6 }, /* ldsha [rs1+%g0],d */
  203.  
  204. { "ldstuba",    F3(3, 0x1d, 0), F3(~3, ~0x1d, ~0),        "[1+2]A,d", 0, v6 },
  205. { "ldstuba",    F3(3, 0x1d, 0), F3(~3, ~0x1d, ~0)|RS2_G0,    "[1]A,d", 0, v6 }, /* ldstuba [rs1+%g0],d */
  206.  
  207.  
  208. { "lduba",    F3(3, 0x11, 0), F3(~3, ~0x11, ~0),        "[1+2]A,d", 0, v6 },
  209. { "lduba",    F3(3, 0x11, 0), F3(~3, ~0x11, ~0)|RS2_G0,    "[1]A,d", 0, v6 }, /* lduba [rs1+%g0],d */
  210.  
  211. { "lduha",    F3(3, 0x12, 0), F3(~3, ~0x12, ~0),        "[1+2]A,d", 0, v6 },
  212. { "lduha",    F3(3, 0x12, 0), F3(~3, ~0x12, ~0)|RS2_G0,    "[1]A,d", 0, v6 }, /* lduha [rs1+%g0],d */
  213.  
  214.  
  215.  
  216. { "st",    F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI(~0),        "d,[1+2]", 0, v6 },
  217. { "st",    F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|ASI_RS2(~0),        "d,[1]", 0, v6 }, /* st d,[rs1+%g0] */
  218. { "st",    F3(3, 0x04, 1), F3(~3, ~0x04, ~1),            "d,[1+i]", 0, v6 },
  219. { "st",    F3(3, 0x04, 1), F3(~3, ~0x04, ~1),            "d,[i+1]", 0, v6 },
  220. { "st",    F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RS1_G0,        "d,[i]", 0, v6 },
  221. { "st",    F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|SIMM13(~0),        "d,[1]", 0, v6 }, /* st d,[rs1+0] */
  222. { "st",    F3(3, 0x24, 0), F3(~3, ~0x24, ~0)|ASI(~0),        "g,[1+2]", 0, v6 },
  223. { "st",    F3(3, 0x24, 0), F3(~3, ~0x24, ~0)|ASI_RS2(~0),        "g,[1]", 0, v6 }, /* st d[rs1+%g0] */
  224. { "st",    F3(3, 0x24, 1), F3(~3, ~0x24, ~1),            "g,[1+i]", 0, v6 },
  225. { "st",    F3(3, 0x24, 1), F3(~3, ~0x24, ~1),            "g,[i+1]", 0, v6 },
  226. { "st",    F3(3, 0x24, 1), F3(~3, ~0x24, ~1)|RS1_G0,        "g,[i]", 0, v6 },
  227. { "st",    F3(3, 0x24, 1), F3(~3, ~0x24, ~1)|SIMM13(~0),        "g,[1]", 0, v6 }, /* st d,[rs1+0] */
  228. { "st",    F3(3, 0x34, 0), F3(~3, ~0x34, ~0)|ASI(~0),        "D,[1+2]", F_ALIAS, v6 },
  229. { "st",    F3(3, 0x34, 0), F3(~3, ~0x34, ~0)|ASI_RS2(~0),        "D,[1]", F_ALIAS, v6 }, /* st d,[rs1+%g0] */
  230. { "st",    F3(3, 0x34, 1), F3(~3, ~0x34, ~1),            "D,[1+i]", F_ALIAS, v6 },
  231. { "st",    F3(3, 0x34, 1), F3(~3, ~0x34, ~1),            "D,[i+1]", F_ALIAS, v6 },
  232. { "st",    F3(3, 0x34, 1), F3(~3, ~0x34, ~1)|RS1_G0,        "D,[i]", F_ALIAS, v6 },
  233. { "st",    F3(3, 0x34, 1), F3(~3, ~0x34, ~1)|SIMM13(~0),        "D,[1]", F_ALIAS, v6 }, /* st d,[rs1+0] */
  234. { "st",    F3(3, 0x35, 0), F3(~3, ~0x35, ~0)|ASI(~0),        "C,[1+2]", 0, v6 },
  235. { "st",    F3(3, 0x35, 0), F3(~3, ~0x35, ~0)|ASI_RS2(~0),        "C,[1]", 0, v6 }, /* st d,[rs1+%g0] */
  236. { "st",    F3(3, 0x35, 1), F3(~3, ~0x35, ~1),            "C,[1+i]", 0, v6 },
  237. { "st",    F3(3, 0x35, 1), F3(~3, ~0x35, ~1),            "C,[i+1]", 0, v6 },
  238. { "st",    F3(3, 0x35, 1), F3(~3, ~0x35, ~1)|RS1_G0,        "C,[i]", 0, v6 },
  239. { "st",    F3(3, 0x35, 1), F3(~3, ~0x35, ~1)|SIMM13(~0),        "C,[1]", 0, v6 }, /* st d,[rs1+0] */
  240.  
  241. { "st",    F3(3, 0x25, 0), F3(~3, ~0x25, ~0)|RD_G0|ASI(~0),    "F,[1+2]", 0, v6 },
  242. { "st",    F3(3, 0x25, 0), F3(~3, ~0x25, ~0)|RD_G0|ASI_RS2(~0),    "F,[1]", 0, v6 }, /* st d,[rs1+%g0] */
  243. { "st",    F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|RD_G0,        "F,[1+i]", 0, v6 },
  244. { "st",    F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|RD_G0,        "F,[i+1]", 0, v6 },
  245. { "st",    F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|RD_G0|RS1_G0,        "F,[i]", 0, v6 },
  246. { "st",    F3(3, 0x25, 1), F3(~3, ~0x25, ~1)|RD_G0|SIMM13(~0),    "F,[1]", 0, v6 }, /* st d,[rs1+0] */
  247.  
  248.  
  249. { "sta",    F3(3, 0x14, 0), F3(~3, ~0x14, ~0),        "d,[1+2]A", 0, v6 },
  250. { "sta",    F3(3, 0x14, 0), F3(~3, ~0x14, ~0)|RS2(~0),    "d,[1]A", 0, v6 }, /* sta d,[rs1+%g0] */
  251.  
  252.  
  253.  
  254. { "stb",    F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|ASI(~0),    "d,[1+2]", 0, v6 },
  255. { "stb",    F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|ASI_RS2(~0),    "d,[1]", 0, v6 }, /* stb d,[rs1+%g0] */
  256. { "stb",    F3(3, 0x05, 1), F3(~3, ~0x05, ~1),        "d,[1+i]", 0, v6 },
  257. { "stb",    F3(3, 0x05, 1), F3(~3, ~0x05, ~1),        "d,[i+1]", 0, v6 },
  258. { "stb",    F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RS1_G0,    "d,[i]", 0, v6 },
  259. { "stb",    F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|SIMM13(~0),    "d,[1]", 0, v6 }, /* stb d,[rs1+0] */
  260.  
  261. { "stba",    F3(3, 0x15, 0), F3(~3, ~0x15, ~0),        "d,[1+2]A", 0, v6 },
  262. { "stba",    F3(3, 0x15, 0), F3(~3, ~0x15, ~0)|RS2(~0),    "d,[1]A", 0, v6 }, /* stba d,[rs1+%g0] */
  263.  
  264. { "std",    F3(3, 0x07, 0), F3(~3, ~0x07, ~0)|ASI(~0),    "d,[1+2]", 0, v6 },
  265. { "std",    F3(3, 0x07, 0), F3(~3, ~0x07, ~0)|ASI_RS2(~0),    "d,[1]", 0, v6 }, /* std d,[rs1+%g0] */
  266. { "std",    F3(3, 0x07, 1), F3(~3, ~0x07, ~1),        "d,[1+i]", 0, v6 },
  267. { "std",    F3(3, 0x07, 1), F3(~3, ~0x07, ~1),        "d,[i+1]", 0, v6 },
  268. { "std",    F3(3, 0x07, 1), F3(~3, ~0x07, ~1)|RS1_G0,    "d,[i]", 0, v6 },
  269. { "std",    F3(3, 0x07, 1), F3(~3, ~0x07, ~1)|SIMM13(~0),    "d,[1]", 0, v6 }, /* std d,[rs1+0] */
  270. { "std",    F3(3, 0x26, 0), F3(~3, ~0x26, ~0)|ASI(~0),    "q,[1+2]", F_ALIAS, v6 },
  271. { "std",    F3(3, 0x26, 0), F3(~3, ~0x26, ~0)|ASI_RS2(~0),    "q,[1]", F_ALIAS, v6 }, /* std d,[rs1+%g0] */
  272. { "std",    F3(3, 0x26, 1), F3(~3, ~0x26, ~1),        "q,[1+i]", F_ALIAS, v6 },
  273. { "std",    F3(3, 0x26, 1), F3(~3, ~0x26, ~1),        "q,[i+1]", F_ALIAS, v6 },
  274. { "std",    F3(3, 0x26, 1), F3(~3, ~0x26, ~1)|RS1_G0,    "q,[i]", F_ALIAS, v6 },
  275. { "std",    F3(3, 0x26, 1), F3(~3, ~0x26, ~1)|SIMM13(~0),    "q,[1]", F_ALIAS, v6 }, /* std d,[rs1+0] */
  276. { "std",    F3(3, 0x27, 0), F3(~3, ~0x27, ~0)|ASI(~0),    "H,[1+2]", 0, v6 },
  277. { "std",    F3(3, 0x27, 0), F3(~3, ~0x27, ~0)|ASI_RS2(~0),    "H,[1]", 0, v6 }, /* std d,[rs1+%g0] */
  278. { "std",    F3(3, 0x27, 1), F3(~3, ~0x27, ~1),        "H,[1+i]", 0, v6 },
  279. { "std",    F3(3, 0x27, 1), F3(~3, ~0x27, ~1),        "H,[i+1]", 0, v6 },
  280. { "std",    F3(3, 0x27, 1), F3(~3, ~0x27, ~1)|RS1_G0,    "H,[i]", 0, v6 },
  281. { "std",    F3(3, 0x27, 1), F3(~3, ~0x27, ~1)|SIMM13(~0),    "H,[1]", 0, v6 }, /* std d,[rs1+0] */
  282. { "std",    F3(3, 0x36, 0), F3(~3, ~0x36, ~0)|ASI(~0),    "Q,[1+2]", F_ALIAS, v6 },
  283. { "std",    F3(3, 0x36, 0), F3(~3, ~0x36, ~0)|ASI_RS2(~0),    "Q,[1]", F_ALIAS, v6 }, /* std d,[rs1+%g0] */
  284. { "std",    F3(3, 0x36, 1), F3(~3, ~0x36, ~1),        "Q,[1+i]", F_ALIAS, v6 },
  285. { "std",    F3(3, 0x36, 1), F3(~3, ~0x36, ~1),        "Q,[i+1]", F_ALIAS, v6 },
  286. { "std",    F3(3, 0x36, 1), F3(~3, ~0x36, ~1)|RS1_G0,    "Q,[i]", F_ALIAS, v6 },
  287. { "std",    F3(3, 0x36, 1), F3(~3, ~0x36, ~1)|SIMM13(~0),    "Q,[1]", F_ALIAS, v6 }, /* std d,[rs1+0] */
  288. { "std",    F3(3, 0x37, 0), F3(~3, ~0x37, ~0)|ASI(~0),    "D,[1+2]", F_ALIAS, v6 },
  289. { "std",    F3(3, 0x37, 0), F3(~3, ~0x37, ~0)|ASI_RS2(~0),    "D,[1]", F_ALIAS, v6 }, /* std d,[rs1+%g0] */
  290. { "std",    F3(3, 0x37, 1), F3(~3, ~0x37, ~1),        "D,[1+i]", F_ALIAS, v6 },
  291. { "std",    F3(3, 0x37, 1), F3(~3, ~0x37, ~1),        "D,[i+1]", F_ALIAS, v6 },
  292. { "std",    F3(3, 0x37, 1), F3(~3, ~0x37, ~1)|RS1_G0,    "D,[i]", F_ALIAS, v6 },
  293. { "std",    F3(3, 0x37, 1), F3(~3, ~0x37, ~1)|SIMM13(~0),    "D,[1]", F_ALIAS, v6 }, /* std d,[rs1+0] */
  294.  
  295. { "stda",    F3(3, 0x17, 0), F3(~3, ~0x17, ~0),        "d,[1+2]A", 0, v6 },
  296. { "stda",    F3(3, 0x17, 0), F3(~3, ~0x17, ~0)|RS2(~0),    "d,[1]A", 0, v6 }, /* stda d,[rs1+%g0] */
  297.  
  298. { "sth",    F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|ASI(~0),    "d,[1+2]", 0, v6 },
  299. { "sth",    F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|ASI_RS2(~0),    "d,[1]", 0, v6 }, /* sth d,[rs1+%g0] */
  300. { "sth",    F3(3, 0x06, 1), F3(~3, ~0x06, ~1),        "d,[1+i]", 0, v6 },
  301. { "sth",    F3(3, 0x06, 1), F3(~3, ~0x06, ~1),        "d,[i+1]", 0, v6 },
  302. { "sth",    F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RS1_G0,    "d,[i]", 0, v6 },
  303. { "sth",    F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|SIMM13(~0),    "d,[1]", 0, v6 }, /* sth d,[+] */
  304.  
  305. { "stha",    F3(3, 0x16, 0), F3(~3, ~0x16, ~0),        "d,[1+2]A", 0, v6 },
  306. { "stha",    F3(3, 0x16, 0), F3(~3, ~0x16, ~0)|RS2(~0),    "d,[1]A", 0, v6 }, /* stha ,[+%] */
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313. { "swap",    F3(3, 0x0f, 0), F3(~3, ~0x0f, ~0)|ASI(~0),    "[1+2],d", 0, v7 },
  314. { "swap",    F3(3, 0x0f, 0), F3(~3, ~0x0f, ~0)|ASI_RS2(~0),    "[1],d", 0, v7 }, /* swap [rs1+%g0],d */
  315. { "swap",    F3(3, 0x0f, 1), F3(~3, ~0x0f, ~1),        "[1+i],d", 0, v7 },
  316. { "swap",    F3(3, 0x0f, 1), F3(~3, ~0x0f, ~1),        "[i+1],d", 0, v7 },
  317. { "swap",    F3(3, 0x0f, 1), F3(~3, ~0x0f, ~1)|RS1_G0,    "[i],d", 0, v7 },
  318. { "swap",    F3(3, 0x0f, 1), F3(~3, ~0x0f, ~1)|SIMM13(~0),    "[1],d", 0, v7 }, /* swap [rs1+0],d */
  319.  
  320. { "swapa",    F3(3, 0x1f, 0), F3(~3, ~0x1f, ~0),        "[1+2]A,d", 0, v7 },
  321. { "swapa",    F3(3, 0x1f, 0), F3(~3, ~0x1f, ~0)|RS2(~0),    "[1]A,d", 0, v7 }, /* swapa [rs1+%g0],d */
  322.  
  323. { "restore",    F3(2, 0x3d, 0), F3(~2, ~0x3d, ~0)|ASI(~0),            "1,2,d", 0, v6 },
  324. { "restore",    F3(2, 0x3d, 0), F3(~2, ~0x3d, ~0)|RD_G0|RS1_G0|ASI_RS2(~0),    "", 0, v6 }, /* restore %g0,%g0,%g0 */
  325. { "restore",    F3(2, 0x3d, 1), F3(~2, ~0x3d, ~1),                "1,i,d", 0, v6 },
  326. { "restore",    F3(2, 0x3d, 1), F3(~2, ~0x3d, ~1)|RD_G0|RS1_G0|SIMM13(~0),    "", 0, v6 }, /* restore %g0,0,%g0 */
  327.  
  328. { "rett",    F3(2, 0x39, 0), F3(~2, ~0x39, ~0)|RD_G0|ASI(~0),    "1+2", F_UNBR|F_DELAYED, v6 }, /* rett rs1+rs2 */
  329. { "rett",    F3(2, 0x39, 0), F3(~2, ~0x39, ~0)|RD_G0|ASI_RS2(~0),    "1", F_UNBR|F_DELAYED, v6 },    /* rett rs1,%g0 */
  330. { "rett",    F3(2, 0x39, 1), F3(~2, ~0x39, ~1)|RD_G0,    "1+i", F_UNBR|F_DELAYED, v6 }, /* rett rs1+X */
  331. { "rett",    F3(2, 0x39, 1), F3(~2, ~0x39, ~1)|RD_G0,    "i+1", F_UNBR|F_DELAYED, v6 }, /* rett X+rs1 */
  332. { "rett",    F3(2, 0x39, 1), F3(~2, ~0x39, ~1)|RD_G0|RS1_G0,"i", F_UNBR|F_DELAYED, v6 }, /* rett X+rs1 */
  333. { "rett",    F3(2, 0x39, 1), F3(~2, ~0x39, ~1)|RD_G0|RS1_G0,    "i", F_UNBR|F_DELAYED, v6 },    /* rett X */
  334. { "rett",    F3(2, 0x39, 1), F3(~2, ~0x39, ~1)|RD_G0|SIMM13(~0),    "1", F_UNBR|F_DELAYED, v6 },    /* rett rs1+0 */
  335.  
  336. { "save",    F3(2, 0x3c, 0), F3(~2, ~0x3c, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  337. { "save",    F3(2, 0x3c, 1), F3(~2, ~0x3c, ~1),        "1,i,d", 0, v6 },
  338. { "save",    0x81e00000,    ~0x81e00000,    "", F_ALIAS, v6 },
  339.  
  340. { "ret",  F3(2, 0x38, 1)|RS1(0x1f)|SIMM13(8), F3(~2, ~0x38, ~1)|SIMM13(~8),           "", F_UNBR|F_DELAYED, v6 }, /* jmpl %i7+8,%g0 */
  341. { "retl", F3(2, 0x38, 1)|RS1(0x0f)|SIMM13(8), F3(~2, ~0x38, ~1)|RS1(~0x0f)|SIMM13(~8), "", F_UNBR|F_DELAYED, v6 }, /* jmpl %o7+8,%g0 */
  342.  
  343. { "jmpl",    F3(2, 0x38, 0), F3(~2, ~0x38, ~0)|ASI(~0),    "1+2,d", F_JSR|F_DELAYED, v6 },
  344. { "jmpl",    F3(2, 0x38, 0), F3(~2, ~0x38, ~0)|ASI_RS2(~0),    "1,d", F_JSR|F_DELAYED, v6 }, /* jmpl rs1+%g0,d */
  345. { "jmpl",    F3(2, 0x38, 1), F3(~2, ~0x38, ~1)|SIMM13(~0),    "1,d", F_JSR|F_DELAYED, v6 }, /* jmpl rs1+0,d */
  346. { "jmpl",    F3(2, 0x38, 1), F3(~2, ~0x38, ~1)|RS1_G0,    "i,d", F_JSR|F_DELAYED, v6 }, /* jmpl %g0+i,d */
  347. { "jmpl",    F3(2, 0x38, 1), F3(~2, ~0x38, ~1),        "1+i,d", F_JSR|F_DELAYED, v6 },
  348. { "jmpl",    F3(2, 0x38, 1), F3(~2, ~0x38, ~1),        "i+1,d", F_JSR|F_DELAYED, v6 },
  349.  
  350.  
  351. { "flush",    F3(2, 0x3b, 0), F3(~2, ~0x3b, ~0)|ASI(~0),    "1+2", 0, v8 },
  352. { "flush",    F3(2, 0x3b, 0), F3(~2, ~0x3b, ~0)|ASI_RS2(~0),    "1", 0, v8 }, /* flush rs1+%g0 */
  353. { "flush",    F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1)|SIMM13(~0),    "1", 0, v8 }, /* flush rs1+0 */
  354. { "flush",    F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1)|RS1_G0,    "i", 0, v8 }, /* flush %g0+i */
  355. { "flush",    F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1),        "1+i", 0, v8 },
  356. { "flush",    F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1),        "i+1", 0, v8 },
  357.  
  358. /* IFLUSH was renamed to FLUSH in v8.  */
  359. { "iflush",    F3(2, 0x3b, 0), F3(~2, ~0x3b, ~0)|ASI(~0),    "1+2", F_ALIAS, v6 },
  360. { "iflush",    F3(2, 0x3b, 0), F3(~2, ~0x3b, ~0)|ASI_RS2(~0),    "1", F_ALIAS, v6 }, /* flush rs1+%g0 */
  361. { "iflush",    F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1)|SIMM13(~0),    "1", F_ALIAS, v6 }, /* flush rs1+0 */
  362. { "iflush",    F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1)|RS1_G0,    "i", F_ALIAS, v6 },
  363. { "iflush",    F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1),        "1+i", F_ALIAS, v6 },
  364. { "iflush",    F3(2, 0x3b, 1), F3(~2, ~0x3b, ~1),        "i+1", F_ALIAS, v6 },
  365.  
  366.  
  367.  
  368. { "stbar",    F3(2, 0x28, 0)|RS1(0xf), F3(~2, ~0x28, ~0)|RD_G0|RS1(~0xf)|SIMM13(~0),    "", 0, v8 },
  369.  
  370.  
  371.  /* The 1<<12 is a long story.  It is necessary.  For more info, please contact rich@cygnus.com */
  372. { "sll",    F3(2, 0x25, 0), F3(~2, ~0x25, ~0)|(1<<12)|ASI(~0),    "1,2,d", 0, v6 },
  373. { "sll",    F3(2, 0x25, 1), F3(~2, ~0x25, ~1)|(1<<12),        "1,i,d", 0, v6 },
  374. { "sra",    F3(2, 0x27, 0), F3(~2, ~0x27, ~0)|(1<<12)|ASI(~0),    "1,2,d", 0, v6 },
  375. { "sra",    F3(2, 0x27, 1), F3(~2, ~0x27, ~1)|(1<<12),        "1,i,d", 0, v6 },
  376. { "srl",    F3(2, 0x26, 0), F3(~2, ~0x26, ~0)|(1<<12)|ASI(~0),    "1,2,d", 0, v6 },
  377. { "srl",    F3(2, 0x26, 1), F3(~2, ~0x26, ~1)|(1<<12),        "1,i,d", 0, v6 },
  378.  
  379.  
  380. { "mulscc",    F3(2, 0x24, 0), F3(~2, ~0x24, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  381. { "mulscc",    F3(2, 0x24, 1), F3(~2, ~0x24, ~1),        "1,i,d", 0, v6 },
  382.  
  383. { "divscc",    F3(2, 0x1d, 0), F3(~2, ~0x1d, ~0)|ASI(~0),    "1,2,d", 0, sparclite },
  384. { "divscc",    F3(2, 0x1d, 1), F3(~2, ~0x1d, ~1),        "1,i,d", 0, sparclite },
  385.  
  386. { "scan",    F3(2, 0x2c, 0), F3(~2, ~0x2c, ~0)|ASI(~0),    "1,2,d", 0, sparclite },
  387. { "scan",    F3(2, 0x2c, 1), F3(~2, ~0x2c, ~1),        "1,i,d", 0, sparclite },
  388.  
  389.  
  390. { "clr",    F3(2, 0x02, 0), F3(~2, ~0x02, ~0)|RD_G0|RS1_G0|ASI_RS2(~0),    "d", F_ALIAS, v6 }, /* or %g0,%g0,d */
  391. { "clr",    F3(2, 0x02, 1), F3(~2, ~0x02, ~1)|RS1_G0|SIMM13(~0),        "d", F_ALIAS, v6 }, /* or %g0,0,d    */
  392. { "clr",    F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|RD_G0|ASI(~0),        "[1+2]", F_ALIAS, v6 },
  393. { "clr",    F3(3, 0x04, 0), F3(~3, ~0x04, ~0)|RD_G0|ASI_RS2(~0),        "[1]", F_ALIAS, v6 }, /* st %g0,[rs1+%g0] */
  394. { "clr",    F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RD_G0,            "[1+i]", F_ALIAS, v6 },
  395. { "clr",    F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RD_G0,            "[i+1]", F_ALIAS, v6 },
  396. { "clr",    F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RD_G0|RS1_G0,        "[i]", F_ALIAS, v6 },
  397. { "clr",    F3(3, 0x04, 1), F3(~3, ~0x04, ~1)|RD_G0|SIMM13(~0),        "[1]", F_ALIAS, v6 }, /* st %g0,[rs1+0] */
  398.  
  399. { "clrb",    F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|RD_G0|ASI(~0),    "[1+2]", F_ALIAS, v6 },
  400. { "clrb",    F3(3, 0x05, 0), F3(~3, ~0x05, ~0)|RD_G0|ASI_RS2(~0),    "[1]", F_ALIAS, v6 }, /* stb %g0,[rs1+%g0] */
  401. { "clrb",    F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RD_G0,        "[1+i]", F_ALIAS, v6 },
  402. { "clrb",    F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RD_G0,        "[i+1]", F_ALIAS, v6 },
  403. { "clrb",    F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RD_G0|RS1_G0,    "[i]", F_ALIAS, v6 },
  404. { "clrb",    F3(3, 0x05, 1), F3(~3, ~0x05, ~1)|RD_G0|SIMM13(~0),    "[1]", F_ALIAS, v6 }, /* clrb [rs1+0],d */
  405.  
  406. { "clrh",    F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|RD_G0|ASI(~0),    "[1+2]", F_ALIAS, v6 },
  407. { "clrh",    F3(3, 0x06, 0), F3(~3, ~0x06, ~0)|RD_G0|ASI_RS2(~0),    "[1]", F_ALIAS, v6 }, /* sth %g0,[rs1+%g0] */
  408. { "clrh",    F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RD_G0,        "[1+i]", F_ALIAS, v6 },
  409. { "clrh",    F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RD_G0,        "[i+1]", F_ALIAS, v6 },
  410. { "clrh",    F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RD_G0|RS1_G0,    "[i]", F_ALIAS, v6 },
  411. { "clrh",    F3(3, 0x06, 1), F3(~3, ~0x06, ~1)|RD_G0|SIMM13(~0),    "[1]", F_ALIAS, v6 }, /* clrb [rs1+0],d */
  412.  
  413. { "orcc",    F3(2, 0x12, 0), F3(~2, ~0x12, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  414. { "orcc",    F3(2, 0x12, 1), F3(~2, ~0x12, ~1),        "1,i,d", 0, v6 },
  415. { "orcc",    F3(2, 0x12, 1), F3(~2, ~0x12, ~1),        "i,1,d", 0, v6 },
  416.  
  417. /* This is not a commutative instruction.  */
  418. { "orncc",    F3(2, 0x16, 0), F3(~2, ~0x16, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  419. { "orncc",    F3(2, 0x16, 1), F3(~2, ~0x16, ~1),        "1,i,d", 0, v6 },
  420.  
  421. /* This is not a commutative instruction.  */
  422. { "orn",    F3(2, 0x06, 0), F3(~2, ~0x06, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  423. { "orn",    F3(2, 0x06, 1), F3(~2, ~0x06, ~1),        "1,i,d", 0, v6 },
  424.  
  425. { "tst",    F3(2, 0x12, 0), F3(~2, ~0x12, ~0)|RD_G0|ASI_RS2(~0),    "1", 0, v6 }, /* orcc rs1, %g0, %g0 */
  426. { "tst",    F3(2, 0x12, 0), F3(~2, ~0x12, ~0)|RD_G0|RS1_G0|ASI(~0),    "2", 0, v6 }, /* orcc %g0, rs2, %g0 */
  427. { "tst",    F3(2, 0x12, 1), F3(~2, ~0x12, ~1)|RD_G0|SIMM13(~0),    "1", 0, v6 }, /* orcc rs1, 0, %g0 */
  428.  
  429. { "wr",    F3(2, 0x30, 0),        F3(~2, ~0x30, ~0)|ASI(~0),        "1,2,m", 0, v8 }, /* wr r,r,%asrX */
  430. { "wr",    F3(2, 0x30, 0),        F3(~2, ~0x30, ~0)|RD_G0|ASI(~0),    "1,2,y", 0, v6 }, /* wr r,r,%y */
  431. { "wr",    F3(2, 0x30, 1),        F3(~2, ~0x30, ~1),            "1,i,m", 0, v8 }, /* wr r,i,%asrX */
  432. { "wr",    F3(2, 0x30, 1),        F3(~2, ~0x30, ~1)|RD_G0,        "1,i,y", 0, v6 }, /* wr r,i,%y */
  433. { "wr",    F3(2, 0x31, 0),        F3(~2, ~0x31, ~0)|RD_G0|ASI(~0),    "1,2,p", F_ALIAS, v6 }, /* wr r,r,%psr */
  434. { "wr",    F3(2, 0x31, 1),        F3(~2, ~0x31, ~1)|RD_G0,        "1,i,p", F_ALIAS, v6 }, /* wr r,i,%psr */
  435. { "wr",    F3(2, 0x32, 0),        F3(~2, ~0x32, ~0)|RD_G0|ASI(~0),    "1,2,w", F_ALIAS, v6 }, /* wr r,r,%wim */
  436. { "wr",    F3(2, 0x32, 1),        F3(~2, ~0x32, ~1)|RD_G0,        "1,i,w", F_ALIAS, v6 }, /* wr r,i,%wim */
  437. { "wr",    F3(2, 0x33, 0),        F3(~2, ~0x33, ~0)|RD_G0|ASI(~0),    "1,2,t", F_ALIAS, v6 }, /* wr r,r,%tbr */
  438. { "wr",    F3(2, 0x33, 1),        F3(~2, ~0x33, ~1)|RD_G0,        "1,i,t", F_ALIAS, v6 }, /* wr r,i,%tbr */
  439.  
  440.  
  441. { "rd",    F3(2, 0x28, 0),            F3(~2, ~0x28, ~0)|SIMM13(~0),        "M,d", 0, v8 }, /* rd %asrX,r */
  442. { "rd",    F3(2, 0x28, 0),            F3(~2, ~0x28, ~0)|RS1_G0|SIMM13(~0),    "y,d", 0, v6 }, /* rd %y,r */
  443. { "rd",    F3(2, 0x29, 0),            F3(~2, ~0x29, ~0)|RS1_G0|SIMM13(~0),    "p,d", F_ALIAS, v6 }, /* rd %psr,r */
  444. { "rd",    F3(2, 0x2a, 0),            F3(~2, ~0x2a, ~0)|RS1_G0|SIMM13(~0),    "w,d", F_ALIAS, v6 }, /* rd %wim,r */
  445. { "rd",    F3(2, 0x2b, 0),            F3(~2, ~0x2b, ~0)|RS1_G0|SIMM13(~0),    "t,d", F_ALIAS, v6 }, /* rd %tbr,r */
  446.  
  447.  
  448.  
  449. { "mov",    F3(2, 0x30, 0),        F3(~2, ~0x30, ~0)|ASI(~0),        "1,2,m", F_ALIAS, v8 }, /* wr r,r,%asrX */
  450. { "mov",    F3(2, 0x30, 0),        F3(~2, ~0x30, ~0)|RD_G0|ASI(~0),    "1,2,y", F_ALIAS, v6 }, /* wr r,r,%y */
  451. { "mov",    F3(2, 0x30, 1),        F3(~2, ~0x30, ~1),            "1,i,m", F_ALIAS, v8 }, /* wr r,i,%asrX */
  452. { "mov",    F3(2, 0x30, 1),        F3(~2, ~0x30, ~1)|RD_G0,        "1,i,y", F_ALIAS, v6 }, /* wr r,i,%y */
  453. { "mov",    F3(2, 0x31, 0),        F3(~2, ~0x31, ~0)|RD_G0|ASI(~0),    "1,2,p", F_ALIAS, v6 }, /* wr r,r,%psr */
  454. { "mov",    F3(2, 0x31, 1),        F3(~2, ~0x31, ~1)|RD_G0,        "1,i,p", F_ALIAS, v6 }, /* wr r,i,%psr */
  455. { "mov",    F3(2, 0x32, 0),        F3(~2, ~0x32, ~0)|RD_G0|ASI(~0),    "1,2,w", F_ALIAS, v6 }, /* wr r,r,%wim */
  456. { "mov",    F3(2, 0x32, 1),        F3(~2, ~0x32, ~1)|RD_G0,        "1,i,w", F_ALIAS, v6 }, /* wr r,i,%wim */
  457. { "mov",    F3(2, 0x33, 0),        F3(~2, ~0x33, ~0)|RD_G0|ASI(~0),    "1,2,t", F_ALIAS, v6 }, /* wr r,r,%tbr */
  458. { "mov",    F3(2, 0x33, 1),        F3(~2, ~0x33, ~1)|RD_G0,        "1,i,t", F_ALIAS, v6 }, /* wr r,i,%tbr */
  459.  
  460. { "mov",    F3(2, 0x28, 0),         F3(~2, ~0x28, ~0)|SIMM13(~0),            "M,d", F_ALIAS, v8 }, /* rd %asr1,r */
  461. { "mov",    F3(2, 0x28, 0),         F3(~2, ~0x28, ~0)|RS1_G0|SIMM13(~0),        "y,d", F_ALIAS, v6 }, /* rd %y,r */
  462. { "mov",    F3(2, 0x29, 0),         F3(~2, ~0x29, ~0)|RS1_G0|SIMM13(~0),        "p,d", F_ALIAS, v6 }, /* rd %psr,r */
  463. { "mov",    F3(2, 0x2a, 0),         F3(~2, ~0x2a, ~0)|RS1_G0|SIMM13(~0),        "w,d", F_ALIAS, v6 }, /* rd %wim,r */
  464. { "mov",    F3(2, 0x2b, 0),         F3(~2, ~0x2b, ~0)|RS1_G0|SIMM13(~0),        "t,d", F_ALIAS, v6 }, /* rd %tbr,r */
  465.  
  466. { "mov",    F3(2, 0x30, 0), F3(~2, ~0x30, ~0)|ASI_RS2(~0),    "1,y", F_ALIAS, v6 }, /* wr rs1,%g0,%y */
  467. { "mov",    F3(2, 0x30, 1), F3(~2, ~0x30, ~1),        "i,y", F_ALIAS, v6 },
  468. { "mov",    F3(2, 0x30, 1), F3(~2, ~0x30, ~1)|SIMM13(~0),    "1,y", F_ALIAS, v6 }, /* wr rs1,0,%y */
  469. { "mov",    F3(2, 0x31, 0), F3(~2, ~0x31, ~0)|ASI_RS2(~0),    "1,p", F_ALIAS, v6 }, /* wr rs1,%g0,%psr */
  470. { "mov",    F3(2, 0x31, 1), F3(~2, ~0x31, ~1),        "i,p", F_ALIAS, v6 },
  471. { "mov",    F3(2, 0x31, 1), F3(~2, ~0x31, ~1)|SIMM13(~0),    "1,p", F_ALIAS, v6 }, /* wr rs1,0,%psr */
  472. { "mov",    F3(2, 0x32, 0), F3(~2, ~0x32, ~0)|ASI_RS2(~0),    "1,w", F_ALIAS, v6 }, /* wr rs1,%g0,%wim */
  473. { "mov",    F3(2, 0x32, 1), F3(~2, ~0x32, ~1),        "i,w", F_ALIAS, v6 },
  474. { "mov",    F3(2, 0x32, 1), F3(~2, ~0x32, ~1)|SIMM13(~0),    "1,w", F_ALIAS, v6 }, /* wr rs1,0,%wim */
  475. { "mov",    F3(2, 0x33, 0), F3(~2, ~0x33, ~0)|ASI_RS2(~0),    "1,t", F_ALIAS, v6 }, /* wr rs1,%g0,%tbr */
  476. { "mov",    F3(2, 0x33, 1), F3(~2, ~0x33, ~1),        "i,t", F_ALIAS, v6 },
  477. { "mov",    F3(2, 0x33, 1), F3(~2, ~0x33, ~1)|SIMM13(~0),    "1,t", F_ALIAS, v6 }, /* wr rs1,0,%tbr */
  478.  
  479. { "mov",    F3(2, 0x02, 0), F3(~2, ~0x02, ~0)|RS1_G0|ASI(~0),    "2,d", 0, v6 }, /* or %g0,rs2,d */
  480. { "mov",    F3(2, 0x02, 1), F3(~2, ~0x02, ~1)|RS1_G0,        "i,d", 0, v6 }, /* or %g0,i,d    */
  481. { "mov",        F3(2, 0x02, 0), F3(~2, ~0x02, ~0)|ASI_RS2(~0),        "1,d", 0, v6 }, /* or rs1,%g0,d   */
  482. { "mov",        F3(2, 0x02, 1), F3(~2, ~0x02, ~1)|SIMM13(~0),        "1,d", 0, v6 }, /* or rs1,0,d */
  483.  
  484. { "or",    F3(2, 0x02, 0), F3(~2, ~0x02, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  485. { "or",    F3(2, 0x02, 1), F3(~2, ~0x02, ~1),        "1,i,d", 0, v6 },
  486. { "or",    F3(2, 0x02, 1), F3(~2, ~0x02, ~1),        "i,1,d", 0, v6 },
  487.  
  488. { "bset",    F3(2, 0x02, 0), F3(~2, ~0x02, ~0)|ASI(~0),    "2,r", F_ALIAS, v6 },    /* or rd,rs2,rd */
  489. { "bset",    F3(2, 0x02, 1), F3(~2, ~0x02, ~1),        "i,r", F_ALIAS, v6 },    /* or rd,i,rd */
  490.  
  491. /* This is not a commutative instruction.  */
  492. { "andn",    F3(2, 0x05, 0), F3(~2, ~0x05, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  493. { "andn",    F3(2, 0x05, 1), F3(~2, ~0x05, ~1),        "1,i,d", 0, v6 },
  494.  
  495. /* This is not a commutative instruction.  */
  496. { "andncc",    F3(2, 0x15, 0), F3(~2, ~0x15, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  497. { "andncc",    F3(2, 0x15, 1), F3(~2, ~0x15, ~1),        "1,i,d", 0, v6 },
  498.  
  499. { "bclr",    F3(2, 0x05, 0), F3(~2, ~0x05, ~0)|ASI(~0),    "2,r", F_ALIAS, v6 },    /* andn rd,rs2,rd */
  500. { "bclr",    F3(2, 0x05, 1), F3(~2, ~0x05, ~1),        "i,r", F_ALIAS, v6 },    /* andn rd,i,rd */
  501.  
  502. { "cmp",    F3(2, 0x14, 0), F3(~2, ~0x14, ~0)|RD_G0|ASI(~0),    "1,2", 0, v6 },    /* subcc rs1,rs2,%g0 */
  503. { "cmp",    F3(2, 0x14, 1), F3(~2, ~0x14, ~1)|RD_G0,        "1,i", 0, v6 },    /* subcc rs1,i,%g0 */
  504.  
  505. { "sub",    F3(2, 0x04, 0), F3(~2, ~0x04, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  506. { "sub",    F3(2, 0x04, 1), F3(~2, ~0x04, ~1),        "1,i,d", 0, v6 },
  507.  
  508. { "subcc",    F3(2, 0x14, 0), F3(~2, ~0x14, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  509. { "subcc",    F3(2, 0x14, 1), F3(~2, ~0x14, ~1),        "1,i,d", 0, v6 },
  510.  
  511. { "subx",    F3(2, 0x0c, 0), F3(~2, ~0x0c, ~0)|ASI(~0),    "1,2,d", F_ALIAS, v6 },
  512. { "subx",    F3(2, 0x0c, 1), F3(~2, ~0x0c, ~1),        "1,i,d", F_ALIAS, v6 },
  513.  
  514. { "subxcc",    F3(2, 0x1c, 0), F3(~2, ~0x1c, ~0)|ASI(~0),    "1,2,d", F_ALIAS, v6 },
  515. { "subxcc",    F3(2, 0x1c, 1), F3(~2, ~0x1c, ~1),        "1,i,d", F_ALIAS, v6 },
  516.  
  517. { "and",    F3(2, 0x01, 0), F3(~2, ~0x01, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  518. { "and",    F3(2, 0x01, 1), F3(~2, ~0x01, ~1),        "1,i,d", 0, v6 },
  519. { "and",    F3(2, 0x01, 1), F3(~2, ~0x01, ~1),        "i,1,d", 0, v6 },
  520.  
  521. { "andcc",    F3(2, 0x11, 0), F3(~2, ~0x11, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  522. { "andcc",    F3(2, 0x11, 1), F3(~2, ~0x11, ~1),        "1,i,d", 0, v6 },
  523. { "andcc",    F3(2, 0x11, 1), F3(~2, ~0x11, ~1),        "i,1,d", 0, v6 },
  524.  
  525. { "dec",    F3(2, 0x04, 1)|SIMM13(0x1), F3(~2, ~0x04, ~1)|SIMM13(~0x0001), "r", F_ALIAS, v6 },    /* sub rd,1,rd */
  526. { "dec",    F3(2, 0x04, 1),            F3(~2, ~0x04, ~1),               "i,r", F_ALIAS, v8 },    /* sub rd,imm,rd */
  527. { "deccc",    F3(2, 0x14, 1)|SIMM13(0x1), F3(~2, ~0x14, ~1)|SIMM13(~0x0001), "r", F_ALIAS, v6 },    /* subcc rd,1,rd */
  528. { "deccc",    F3(2, 0x14, 1),            F3(~2, ~0x14, ~1),               "i,r", F_ALIAS, v8 },    /* subcc rd,imm,rd */
  529. { "inc",    F3(2, 0x00, 1)|SIMM13(0x1), F3(~2, ~0x00, ~1)|SIMM13(~0x0001), "r", F_ALIAS, v6 },    /* add rd,1,rd */
  530. { "inc",    F3(2, 0x00, 1),            F3(~2, ~0x00, ~1),               "i,r", F_ALIAS, v8 },    /* add rd,imm,rd */
  531. { "inccc",    F3(2, 0x10, 1)|SIMM13(0x1), F3(~2, ~0x10, ~1)|SIMM13(~0x0001), "r", F_ALIAS, v6 },    /* addcc rd,1,rd */
  532. { "inccc",    F3(2, 0x10, 1),            F3(~2, ~0x10, ~1),               "i,r", F_ALIAS, v8 },    /* addcc rd,imm,rd */
  533.  
  534. { "btst",    F3(2, 0x11, 0), F3(~2, ~0x11, ~0)|RD_G0|ASI(~0), "1,2", F_ALIAS, v6 },    /* andcc rs1,rs2,%g0 */
  535. { "btst",    F3(2, 0x11, 1), F3(~2, ~0x11, ~1)|RD_G0, "i,1", F_ALIAS, v6 },    /* andcc rs1,i,%g0 */
  536.  
  537. { "neg",    F3(2, 0x04, 0), F3(~2, ~0x04, ~0)|RS1_G0|ASI(~0), "2,d", F_ALIAS, v6 }, /* sub %g0,rs2,rd */
  538. { "neg",    F3(2, 0x04, 0), F3(~2, ~0x04, ~0)|RS1_G0|ASI(~0), "r", F_ALIAS, v6 }, /* sub %g0,rd,rd */
  539.  
  540. { "add",    F3(2, 0x00, 0), F3(~2, ~0x00, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  541. { "add",    F3(2, 0x00, 1), F3(~2, ~0x00, ~1),        "1,i,d", 0, v6 },
  542. { "add",    F3(2, 0x00, 1), F3(~2, ~0x00, ~1),        "i,1,d", 0, v6 },
  543. { "addcc",    F3(2, 0x10, 0), F3(~2, ~0x10, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  544. { "addcc",    F3(2, 0x10, 1), F3(~2, ~0x10, ~1),        "1,i,d", 0, v6 },
  545. { "addcc",    F3(2, 0x10, 1), F3(~2, ~0x10, ~1),        "i,1,d", 0, v6 },
  546. { "addx",    F3(2, 0x08, 0), F3(~2, ~0x08, ~0)|ASI(~0),    "1,2,d", F_ALIAS, v6 },
  547. { "addx",    F3(2, 0x08, 1), F3(~2, ~0x08, ~1),        "1,i,d", F_ALIAS, v6 },
  548. { "addx",    F3(2, 0x08, 1), F3(~2, ~0x08, ~1),        "i,1,d", F_ALIAS, v6 },
  549. { "addxcc",    F3(2, 0x18, 0), F3(~2, ~0x18, ~0)|ASI(~0),    "1,2,d", F_ALIAS, v6 },
  550. { "addxcc",    F3(2, 0x18, 1), F3(~2, ~0x18, ~1),        "1,i,d", F_ALIAS, v6 },
  551. { "addxcc",    F3(2, 0x18, 1), F3(~2, ~0x18, ~1),        "i,1,d", F_ALIAS, v6 },
  552.  
  553. { "smul",    F3(2, 0x0b, 0), F3(~2, ~0x0b, ~0)|ASI(~0),    "1,2,d", 0, v8 },
  554. { "smul",    F3(2, 0x0b, 1), F3(~2, ~0x0b, ~1),        "1,i,d", 0, v8 },
  555. { "smul",    F3(2, 0x0b, 1), F3(~2, ~0x0b, ~1),        "i,1,d", 0, v8 },
  556. { "smulcc",    F3(2, 0x1b, 0), F3(~2, ~0x1b, ~0)|ASI(~0),    "1,2,d", 0, v8 },
  557. { "smulcc",    F3(2, 0x1b, 1), F3(~2, ~0x1b, ~1),        "1,i,d", 0, v8 },
  558. { "smulcc",    F3(2, 0x1b, 1), F3(~2, ~0x1b, ~1),        "i,1,d", 0, v8 },
  559. { "umul",    F3(2, 0x0a, 0), F3(~2, ~0x0a, ~0)|ASI(~0),    "1,2,d", 0, v8 },
  560. { "umul",    F3(2, 0x0a, 1), F3(~2, ~0x0a, ~1),        "1,i,d", 0, v8 },
  561. { "umul",    F3(2, 0x0a, 1), F3(~2, ~0x0a, ~1),        "i,1,d", 0, v8 },
  562. { "umulcc",    F3(2, 0x1a, 0), F3(~2, ~0x1a, ~0)|ASI(~0),    "1,2,d", 0, v8 },
  563. { "umulcc",    F3(2, 0x1a, 1), F3(~2, ~0x1a, ~1),        "1,i,d", 0, v8 },
  564. { "umulcc",    F3(2, 0x1a, 1), F3(~2, ~0x1a, ~1),        "i,1,d", 0, v8 },
  565. { "sdiv",    F3(2, 0x0f, 0), F3(~2, ~0x0f, ~0)|ASI(~0),    "1,2,d", 0, v8 },
  566. { "sdiv",    F3(2, 0x0f, 1), F3(~2, ~0x0f, ~1),        "1,i,d", 0, v8 },
  567. { "sdiv",    F3(2, 0x0f, 1), F3(~2, ~0x0f, ~1),        "i,1,d", 0, v8 },
  568. { "sdivcc",    F3(2, 0x1f, 0), F3(~2, ~0x1f, ~0)|ASI(~0),    "1,2,d", 0, v8 },
  569. { "sdivcc",    F3(2, 0x1f, 1), F3(~2, ~0x1f, ~1),        "1,i,d", 0, v8 },
  570. { "sdivcc",    F3(2, 0x1f, 1), F3(~2, ~0x1f, ~1),        "i,1,d", 0, v8 },
  571. { "udiv",    F3(2, 0x0e, 0), F3(~2, ~0x0e, ~0)|ASI(~0),    "1,2,d", 0, v8 },
  572. { "udiv",    F3(2, 0x0e, 1), F3(~2, ~0x0e, ~1),        "1,i,d", 0, v8 },
  573. { "udiv",    F3(2, 0x0e, 1), F3(~2, ~0x0e, ~1),        "i,1,d", 0, v8 },
  574. { "udivcc",    F3(2, 0x1e, 0), F3(~2, ~0x1e, ~0)|ASI(~0),    "1,2,d", 0, v8 },
  575. { "udivcc",    F3(2, 0x1e, 1), F3(~2, ~0x1e, ~1),        "1,i,d", 0, v8 },
  576. { "udivcc",    F3(2, 0x1e, 1), F3(~2, ~0x1e, ~1),        "i,1,d", 0, v8 },
  577.  
  578.  
  579. { "call",    F1(0x1), F1(~0x1), "L", F_JSR|F_DELAYED, v6 },
  580. { "call",    F1(0x1), F1(~0x1), "L,#", F_JSR|F_DELAYED, v6 },
  581.  
  582. { "call",    F3(2, 0x38, 0)|RD(0xf), F3(~2, ~0x38, ~0)|RD(~0xf)|ASI(~0),    "1+2", F_JSR|F_DELAYED, v6 }, /* jmpl rs1+rs2,%o7 */
  583. { "call",    F3(2, 0x38, 0)|RD(0xf), F3(~2, ~0x38, ~0)|RD(~0xf)|ASI(~0),    "1+2,#", F_JSR|F_DELAYED, v6 },
  584. { "call",    F3(2, 0x38, 0)|RD(0xf), F3(~2, ~0x38, ~0)|RD(~0xf)|ASI_RS2(~0),    "1", F_JSR|F_DELAYED, v6 }, /* jmpl rs1+%g0,%o7 */
  585. { "call",    F3(2, 0x38, 0)|RD(0xf), F3(~2, ~0x38, ~0)|RD(~0xf)|ASI_RS2(~0),    "1,#", F_JSR|F_DELAYED, v6 },
  586. { "call",    F3(2, 0x38, 1)|RD(0xf), F3(~2, ~0x38, ~1)|RD(~0xf),        "1+i", F_JSR|F_DELAYED, v6 }, /* jmpl rs1+i,%o7 */
  587. { "call",    F3(2, 0x38, 1)|RD(0xf), F3(~2, ~0x38, ~1)|RD(~0xf),        "1+i,#", F_JSR|F_DELAYED, v6 },
  588. { "call",    F3(2, 0x38, 1)|RD(0xf), F3(~2, ~0x38, ~1)|RD(~0xf),        "i+1", F_JSR|F_DELAYED, v6 }, /* jmpl i+rs1,%o7 */
  589. { "call",    F3(2, 0x38, 1)|RD(0xf), F3(~2, ~0x38, ~1)|RD(~0xf),        "i+1,#", F_JSR|F_DELAYED, v6 },
  590. { "call",    F3(2, 0x38, 1)|RD(0xf), F3(~2, ~0x38, ~1)|RD(~0xf)|RS1_G0,    "i", F_JSR|F_DELAYED, v6 }, /* jmpl %g0+i,%o7 */
  591. { "call",    F3(2, 0x38, 1)|RD(0xf), F3(~2, ~0x38, ~1)|RD(~0xf)|RS1_G0,    "i,#", F_JSR|F_DELAYED, v6 },
  592. { "call",    F3(2, 0x38, 1)|RD(0xf), F3(~2, ~0x38, ~1)|RD(~0xf)|SIMM13(~0),    "1", F_JSR|F_DELAYED, v6 }, /* jmpl rs1+0,%o7 */
  593. { "call",    F3(2, 0x38, 1)|RD(0xf), F3(~2, ~0x38, ~1)|RD(~0xf)|SIMM13(~0),    "1,#", F_JSR|F_DELAYED, v6 },
  594.  
  595.  
  596. /* Conditional instructions.
  597.  
  598.    Because this part of the table was such a mess earlier, I have
  599.    macrofied it so that all the branches and traps are generated from
  600.    a single-line description of each condition value.  John Gilmore. */
  601.  
  602. /* Define branches -- one annulled, one without, etc. */
  603. #define br(opcode, mask, lose, flags) \
  604.  { opcode, (mask)|ANNUL, (lose),       ",a l",   (flags), v6 }, \
  605.  { opcode, (mask)      , (lose)|ANNUL, "l",     (flags), v6 }
  606.  
  607.  
  608. /* Define four traps: reg+reg, reg + immediate, immediate alone, reg alone. */
  609. #define tr(opcode, mask, lose, flags) \
  610.  { opcode, (mask)|IMMED, (lose)|RS1_G0,        "i",     (flags), v6 }, /* %g0 + imm */ \
  611.  { opcode, (mask)|IMMED, (lose),        "1+i",   (flags), v6 }, /* rs1 + imm */ \
  612.  { opcode, (mask), IMMED|(lose),        "1+2",   (flags), v6 }, /* rs1 + rs2 */ \
  613.  { opcode, (mask), IMMED|(lose)|RS2_G0,        "1",     (flags), v6 } /* rs1 + %g0 */
  614.  
  615.  
  616. /* Define both branches and traps based on condition mask */
  617. #define cond(bop, top, mask, flags) \
  618.   br(bop,  F2(0, 2)|(mask), F2(~0, ~2)|((~mask)&COND(~0)), F_DELAYED|(flags)), \
  619.   tr(top,  F3(2, 0x3a, 0)|(mask), F3(~2, ~0x3a, 0)|((~mask)&COND(~0)), ((flags) & ~(F_UNBR|F_CONDBR)))
  620.  
  621. /* Define all the conditions, all the branches, all the traps.  */
  622.  
  623. /* Standard branch, trap mnemonics */
  624. cond ("b",    "ta",   CONDA, F_UNBR),
  625. /* Alternative form (just for assembly, not for disassembly) */
  626. cond ("ba",    "t",    CONDA, F_UNBR|F_ALIAS),
  627.  
  628. cond ("bcc",    "tcc",  CONDCC, F_CONDBR),
  629. cond ("bcs",    "tcs",  CONDCS, F_CONDBR),
  630. cond ("be",    "te",   CONDE, F_CONDBR),
  631. cond ("bg",    "tg",   CONDG, F_CONDBR),
  632. cond ("bgt",    "tgt",   CONDG, F_CONDBR|F_ALIAS),
  633. cond ("bge",    "tge",  CONDGE, F_CONDBR),
  634. cond ("bgeu",    "tgeu", CONDGEU, F_CONDBR|F_ALIAS), /* for cc */
  635. cond ("bgu",    "tgu",  CONDGU, F_CONDBR),
  636. cond ("bl",    "tl",   CONDL, F_CONDBR),
  637. cond ("blt",    "tlt",   CONDL, F_CONDBR|F_ALIAS),
  638. cond ("ble",    "tle",  CONDLE, F_CONDBR),
  639. cond ("bleu",    "tleu", CONDLEU, F_CONDBR),
  640. cond ("blu",    "tlu",  CONDLU, F_CONDBR|F_ALIAS), /* for cs */
  641. cond ("bn",    "tn",   CONDN, F_CONDBR),
  642. cond ("bne",    "tne",  CONDNE, F_CONDBR),
  643. cond ("bneg",    "tneg", CONDNEG, F_CONDBR),
  644. cond ("bnz",    "tnz",  CONDNZ, F_CONDBR|F_ALIAS), /* for ne */
  645. cond ("bpos",    "tpos", CONDPOS, F_CONDBR),
  646. cond ("bvc",    "tvc",  CONDVC, F_CONDBR),
  647. cond ("bvs",    "tvs",  CONDVS, F_CONDBR),
  648. cond ("bz",    "tz",   CONDZ, F_CONDBR|F_ALIAS), /* for e */
  649.  
  650. #undef cond
  651. #undef br
  652. #undef tr
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677. #define brfc(opcode, mask, lose, flags) \
  678.  { opcode, (mask), ANNUL|(lose), "l",    flags|F_DELAYED, v6 }, \
  679.  { opcode, (mask)|ANNUL, (lose), ",a l", flags|F_DELAYED, v6 }
  680.  
  681.  
  682.  
  683. #define condfc(fop, cop, mask, flags) \
  684.   brfc(fop, F2(0, 6)|COND(mask), F2(~0, ~6)|COND(~(mask)), flags), \
  685.   brfc(cop, F2(0, 7)|COND(mask), F2(~0, ~7)|COND(~(mask)), flags)
  686.  
  687. #define condf(fop, mask, flags) \
  688.   brfc(fop, F2(0, 6)|COND(mask), F2(~0, ~6)|COND(~(mask)), flags)
  689.  
  690. condfc("fb",    "cb",     0x8, 0),
  691. condfc("fba",    "cba",     0x8, F_ALIAS),
  692. condfc("fbe",    "cb0",     0x9, 0),
  693. condf("fbz",         0x9, F_ALIAS),
  694. condfc("fbg",    "cb2",     0x6, 0),
  695. condfc("fbge",    "cb02",     0xb, 0),
  696. condfc("fbl",    "cb1",     0x4, 0),
  697. condfc("fble",    "cb01",     0xd, 0),
  698. condfc("fblg",    "cb12",     0x2, 0),
  699. condfc("fbn",    "cbn",     0x0, 0),
  700. condfc("fbne",    "cb123", 0x1, 0),
  701. condf("fbnz",         0x1, F_ALIAS),
  702. condfc("fbo",    "cb012", 0xf, 0),
  703. condfc("fbu",    "cb3",     0x7, 0),
  704. condfc("fbue",    "cb03",     0xa, 0),
  705. condfc("fbug",    "cb23",     0x5, 0),
  706. condfc("fbuge",    "cb023", 0xc, 0),
  707. condfc("fbul",    "cb13",     0x3, 0),
  708. condfc("fbule",    "cb013", 0xe, 0),
  709.  
  710. #undef condfc
  711. #undef brfc
  712.  
  713. { "jmp",    F3(2, 0x38, 0), F3(~2, ~0x38, ~0)|RD_G0|ASI(~0),    "1+2", F_UNBR|F_DELAYED, v6 }, /* jmpl rs1+rs2,%g0 */
  714. { "jmp",    F3(2, 0x38, 0), F3(~2, ~0x38, ~0)|RD_G0|ASI_RS2(~0),    "1", F_UNBR|F_DELAYED, v6 }, /* jmpl rs1+%g0,%g0 */
  715. { "jmp",    F3(2, 0x38, 1), F3(~2, ~0x38, ~1)|RD_G0,        "1+i", F_UNBR|F_DELAYED, v6 }, /* jmpl rs1+i,%g0 */
  716. { "jmp",    F3(2, 0x38, 1), F3(~2, ~0x38, ~1)|RD_G0,        "i+1", F_UNBR|F_DELAYED, v6 }, /* jmpl i+rs1,%g0 */
  717. { "jmp",    F3(2, 0x38, 1), F3(~2, ~0x38, ~1)|RD_G0|RS1_G0,        "i", F_UNBR|F_DELAYED, v6 }, /* jmpl %g0+i,%g0 */
  718. { "jmp",    F3(2, 0x38, 1), F3(~2, ~0x38, ~1)|RD_G0|SIMM13(~0),    "1", F_UNBR|F_DELAYED, v6 }, /* jmpl rs1+0,%g0 */
  719.  
  720. { "nop",    F2(0, 4), 0xfeffffff, "", 0, v6 }, /* sethi 0, %g0 */
  721.  
  722. { "set",    F2(0x0, 0x4), F2(~0x0, ~0x4), "Sh,d", F_ALIAS, v6 },
  723.  
  724. { "sethi",    F2(0x0, 0x4), F2(~0x0, ~0x4), "h,d", 0, v6 },
  725.  
  726. { "taddcc",    F3(2, 0x20, 0), F3(~2, ~0x20, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  727. { "taddcc",    F3(2, 0x20, 1), F3(~2, ~0x20, ~1),        "1,i,d", 0, v6 },
  728. { "taddcc",    F3(2, 0x20, 1), F3(~2, ~0x20, ~1),        "i,1,d", 0, v6 },
  729. { "taddcctv",    F3(2, 0x22, 0), F3(~2, ~0x22, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  730. { "taddcctv",    F3(2, 0x22, 1), F3(~2, ~0x22, ~1),        "1,i,d", 0, v6 },
  731. { "taddcctv",    F3(2, 0x22, 1), F3(~2, ~0x22, ~1),        "i,1,d", 0, v6 },
  732.  
  733. { "tsubcc",    F3(2, 0x21, 0), F3(~2, ~0x21, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  734. { "tsubcc",    F3(2, 0x21, 1), F3(~2, ~0x21, ~1),        "1,i,d", 0, v6 },
  735. { "tsubcctv",    F3(2, 0x23, 0), F3(~2, ~0x23, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  736. { "tsubcctv",    F3(2, 0x23, 1), F3(~2, ~0x23, ~1),        "1,i,d", 0, v6 },
  737.  
  738. { "unimp",    F2(0x0, 0x0), 0xffc00000, "n", F_ALIAS, v6 },
  739.  
  740. /* This *is* a commutative instruction.  */
  741. { "xnor",    F3(2, 0x07, 0), F3(~2, ~0x07, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  742. { "xnor",    F3(2, 0x07, 1), F3(~2, ~0x07, ~1),        "1,i,d", 0, v6 },
  743. { "xnor",    F3(2, 0x07, 1), F3(~2, ~0x07, ~1),        "i,1,d", 0, v6 },
  744. /* This *is* a commutative instruction.  */
  745. { "xnorcc",    F3(2, 0x17, 0), F3(~2, ~0x17, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  746. { "xnorcc",    F3(2, 0x17, 1), F3(~2, ~0x17, ~1),        "1,i,d", 0, v6 },
  747. { "xnorcc",    F3(2, 0x17, 1), F3(~2, ~0x17, ~1),        "i,1,d", 0, v6 },
  748. { "xor",    F3(2, 0x03, 0), F3(~2, ~0x03, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  749. { "xor",    F3(2, 0x03, 1), F3(~2, ~0x03, ~1),        "1,i,d", 0, v6 },
  750. { "xor",    F3(2, 0x03, 1), F3(~2, ~0x03, ~1),        "i,1,d", 0, v6 },
  751. { "xorcc",    F3(2, 0x13, 0), F3(~2, ~0x13, ~0)|ASI(~0),    "1,2,d", 0, v6 },
  752. { "xorcc",    F3(2, 0x13, 1), F3(~2, ~0x13, ~1),        "1,i,d", 0, v6 },
  753. { "xorcc",    F3(2, 0x13, 1), F3(~2, ~0x13, ~1),        "i,1,d", 0, v6 },
  754.  
  755. { "not",    F3(2, 0x07, 0), F3(~2, ~0x07, ~0)|ASI(~0), "1,d", F_ALIAS, v6 }, /* xnor rs1,%0,rd */
  756. { "not",    F3(2, 0x07, 0), F3(~2, ~0x07, ~0)|ASI(~0), "r", F_ALIAS, v6 }, /* xnor rd,%0,rd */
  757.  
  758. { "btog",    F3(2, 0x03, 0), F3(~2, ~0x03, ~0)|ASI(~0),    "2,r", F_ALIAS, v6 }, /* xor rd,rs2,rd */
  759. { "btog",    F3(2, 0x03, 1), F3(~2, ~0x03, ~1),        "i,r", F_ALIAS, v6 }, /* xor rd,i,rd */
  760.  
  761. /* FPop1 and FPop2 are not instructions.  Don't accept them.  */
  762.  
  763. { "fdtoi",    F3F(2, 0x34, 0x0d2), F3F(~2, ~0x34, ~0x0d2)|RS1_G0, "B,g", 0, v6 },
  764. { "fstoi",    F3F(2, 0x34, 0x0d1), F3F(~2, ~0x34, ~0x0d1)|RS1_G0, "f,g", 0, v6 },
  765. { "fqtoi",    F3F(2, 0x34, 0x0d3), F3F(~2, ~0x34, ~0x0d3)|RS1_G0, "R,g", 0, v8 },
  766.  
  767.  
  768. { "fitod",    F3F(2, 0x34, 0x0c8), F3F(~2, ~0x34, ~0x0c8)|RS1_G0, "f,H", 0, v6 },
  769. { "fitos",    F3F(2, 0x34, 0x0c4), F3F(~2, ~0x34, ~0x0c4)|RS1_G0, "f,g", 0, v6 },
  770. { "fitoq",    F3F(2, 0x34, 0x0cc), F3F(~2, ~0x34, ~0x0cc)|RS1_G0, "f,J", 0, v8 },
  771.  
  772.  
  773. { "fdtoq",    F3F(2, 0x34, 0x0ce), F3F(~2, ~0x34, ~0x0ce)|RS1_G0, "B,J", 0, v8 },
  774. { "fdtos",    F3F(2, 0x34, 0x0c6), F3F(~2, ~0x34, ~0x0c6)|RS1_G0, "B,g", 0, v6 },
  775. { "fqtod",    F3F(2, 0x34, 0x0cb), F3F(~2, ~0x34, ~0x0cb)|RS1_G0, "R,H", 0, v8 },
  776. { "fqtos",    F3F(2, 0x34, 0x0c7), F3F(~2, ~0x34, ~0x0c7)|RS1_G0, "R,g", 0, v8 },
  777. { "fstod",    F3F(2, 0x34, 0x0c9), F3F(~2, ~0x34, ~0x0c9)|RS1_G0, "f,H", 0, v6 },
  778. { "fstoq",    F3F(2, 0x34, 0x0cd), F3F(~2, ~0x34, ~0x0cd)|RS1_G0, "f,J", 0, v8 },
  779.  
  780. { "fdivd",    F3F(2, 0x34, 0x04e), F3F(~2, ~0x34, ~0x04e), "v,B,H", 0, v6 },
  781. { "fdivq",    F3F(2, 0x34, 0x04f), F3F(~2, ~0x34, ~0x04f), "V,R,J", 0, v8 },
  782. { "fdivs",    F3F(2, 0x34, 0x04d), F3F(~2, ~0x34, ~0x04d), "e,f,g", 0, v6 },
  783. { "fmuld",    F3F(2, 0x34, 0x04a), F3F(~2, ~0x34, ~0x04a), "v,B,H", 0, v6 },
  784. { "fmulq",    F3F(2, 0x34, 0x04b), F3F(~2, ~0x34, ~0x04b), "V,R,J", 0, v8 },
  785. { "fmuls",    F3F(2, 0x34, 0x049), F3F(~2, ~0x34, ~0x049), "e,f,g", 0, v6 },
  786.  
  787. { "fdmulq",    F3F(2, 0x34, 0x06e), F3F(~2, ~0x34, ~0x06e), "v,B,J", 0, v8 },
  788. { "fsmuld",    F3F(2, 0x34, 0x069), F3F(~2, ~0x34, ~0x069), "e,f,H", 0, v8 },
  789.  
  790. { "fsqrtd",    F3F(2, 0x34, 0x02a), F3F(~2, ~0x34, ~0x02a)|RS1_G0, "B,H", 0, v7 },
  791. { "fsqrtq",    F3F(2, 0x34, 0x02b), F3F(~2, ~0x34, ~0x02b)|RS1_G0, "R,J", 0, v8 },
  792. { "fsqrts",    F3F(2, 0x34, 0x029), F3F(~2, ~0x34, ~0x029)|RS1_G0, "f,g", 0, v7 },
  793.  
  794. { "fabss",    F3F(2, 0x34, 0x009), F3F(~2, ~0x34, ~0x009)|RS1_G0, "f,g", 0, v6 },
  795. { "fmovs",    F3F(2, 0x34, 0x001), F3F(~2, ~0x34, ~0x001)|RS1_G0, "f,g", 0, v6 },
  796. { "fnegs",    F3F(2, 0x34, 0x005), F3F(~2, ~0x34, ~0x005)|RS1_G0, "f,g", 0, v6 },
  797.  
  798. { "faddd",    F3F(2, 0x34, 0x042), F3F(~2, ~0x34, ~0x042), "v,B,H", 0, v6 },
  799. { "faddq",    F3F(2, 0x34, 0x043), F3F(~2, ~0x34, ~0x043), "V,R,J", 0, v8 },
  800. { "fadds",    F3F(2, 0x34, 0x041), F3F(~2, ~0x34, ~0x041), "e,f,g", 0, v6 },
  801. { "fsubd",    F3F(2, 0x34, 0x046), F3F(~2, ~0x34, ~0x046), "v,B,H", 0, v6 },
  802. { "fsubq",    F3F(2, 0x34, 0x047), F3F(~2, ~0x34, ~0x047), "V,R,J", 0, v8 },
  803. { "fsubs",    F3F(2, 0x34, 0x045), F3F(~2, ~0x34, ~0x045), "e,f,g", 0, v6 },
  804.  
  805. #define CMPFCC(x)    (((x)&0x3)<<25)
  806.  
  807. { "fcmpd",              F3F(2, 0x35, 0x052),            F3F(~2, ~0x35, ~0x052)|RD_G0,  "v,B",   0, v6 },
  808. { "fcmped",              F3F(2, 0x35, 0x056),            F3F(~2, ~0x35, ~0x056)|RD_G0,  "v,B",   0, v6 },
  809. { "fcmpq",              F3F(2, 0x34, 0x053),            F3F(~2, ~0x34, ~0x053)|RD_G0,     "V,R", 0, v8 },
  810. { "fcmpeq",              F3F(2, 0x34, 0x057),            F3F(~2, ~0x34, ~0x057)|RD_G0,     "V,R", 0, v8 },
  811. { "fcmps",              F3F(2, 0x35, 0x051),            F3F(~2, ~0x35, ~0x051)|RD_G0, "e,f",   0, v6 },
  812. { "fcmpes",              F3F(2, 0x35, 0x055),            F3F(~2, ~0x35, ~0x055)|RD_G0, "e,f",   0, v6 },
  813.  
  814. { "cpop1",    F3(2, 0x36, 0), F3(~2, ~0x36, ~1), "[1+2],d", F_ALIAS, v6 },
  815. { "cpop2",    F3(2, 0x37, 0), F3(~2, ~0x37, ~1), "[1+2],d", F_ALIAS, v6 },
  816.  
  817.     
  818.  
  819. };
  820.  
  821. const int bfd_sparc_num_opcodes = ((sizeof sparc_opcodes)/(sizeof sparc_opcodes[0]));
  822.